package com.zhl.framework.core.client;


import com.zhl.framework.core.proxy.ProxyFactory;

/**
 * @Author: ZhangLu In DLUT
 * @since: 1.0.0
 * @Description:
 */

public class RpcReference {

    public ProxyFactory proxyFactory;

    public RpcReference(ProxyFactory proxyFactory) {
        this.proxyFactory = proxyFactory;
    }

    /**
     * 根据接口的类型获取代理对象
     * @param tClass 接口类型
     * @param <T> 代理对象类型
     * @return
     * @throws Throwable
     */
    public <T> T get(Class<T> tClass) throws Throwable {
        return proxyFactory.getProxy(tClass);
    }
}
